\begin{verbatim}
function TranslationMatches(S,F,r) 
    // INPUT:
    // S : Test string.
    // F : Sequence of standard frequencies for the language.
    // r : A real number between 0 and 1.
    // OUTPUT:
    // Returns integers k such that affine translation 
    // of S by k has correlation at least r with the standard 
    // frequencies given by the real sequence F.

    X := FrequencyDistribution(S);
    CorrSeq := TranslationCorrelations(X,F);
    return [ x[1] : x in CorrSeq | x[2] gt r ];
end function;
\end{verbatim}
